package ale.android.application;

import ale.android.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;

public class Index extends Activity implements OnCheckedChangeListener {
	/** Called when the activity is first created. */
	RadioGroup rg;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		rg = (RadioGroup) findViewById(R.id.radioGroup1);
	}

	@Override
	protected void onResume() {
		rg.setOnCheckedChangeListener(null);
		rg.clearCheck();
		rg.setOnCheckedChangeListener(this);
		super.onResume();

	}

	public void onCheckedChanged(RadioGroup arg0, int arg1) {

		switch (rg.getCheckedRadioButtonId()) {
		case R.id.radioEnter:
			Intent i = new Intent(this, Menu.class);
			startActivity(i);
			break;
		case R.id.radioQuit:
			finish();
			break;
		}
	}
}